<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<!-- 登录 -->
		<label>
			用户名
			<input id="user" placeholder="请输入用户名" value="admin"/>
		</label>
		<label>
			密码
			<input id="pwd" placeholder="请输入密码" value="123456"/>
		</label>
		<input type="button" value="登录" onclick="login()"/>
		
        <script src="jquery-3.6.0min.js"></script>
    <script>
        function login(){
            var u=$("#user").val();
            var p=$("#pwd").val();
            $.ajax({
                url:"http://127.0.0.1:8080/login",
                type:"get",
                data:{
                    username:u,
                    password:p
                },
                dataType:"json",
                success:function(data){
                    console.log("data",data);
                },
                error:function(err){
                    console.log("err",err);
                }
            })
        }
	
		</script>
	</body>
</html>
